#include "OBB.h"


OBB::OBB(DAEFloat3& c1, DAEFloat3& c2,DAEMatrix& world)
{
	DAEFloat3 diff = c2 - c1;
	
	DAEFloat3 b1,b2,b3,b4;
	DAEFloat3 u1,u2,u3,u4;

	m_b1 = c1;
	m_b2 = c1 + DAEFloat3(diff.x,0,0);
	m_b3 = c1 + DAEFloat3(diff.x,diff.y,0);
	m_b4 = c1 + DAEFloat3(0,diff.y,0);

	m_u1 = c1 + DAEFloat3(0,0,diff.z);
	m_u2 = m_u1 + DAEFloat3(diff.x,0,0);
	m_u3 = m_u1 + DAEFloat3(diff.x,diff.y,0);
	m_u4 = m_u1 + DAEFloat3(0,diff.y,0);

	world.TransformVector(m_b1,m_b1);
	world.TransformVector(m_b2,m_b2);
	world.TransformVector(m_b3,m_b3);
	world.TransformVector(m_b4,m_b4);

	world.TransformVector(m_u1,m_u1);
	world.TransformVector(m_u2,m_u2);
	world.TransformVector(m_u3,m_u3);
	world.TransformVector(m_u4,m_u4);
}


OBB::~OBB(void)
{
}
